#include<iostream>
#include<stdio.h>
#include<stack>
using namespace std; 
int main()
{
	stack <char> p1,p2;
	int rail[1000];
	char s1[27],s2[27];
	gets(s1);
	gets(s2);
	int i=0,j=0,k=0,flag=0;
	while(s1[i]!='\0')
	i++;
	while(i>=0){
	p1.push(s1[i]);
	i--;}
	while(s2[j])
	{
		if(!p1.empty()&&p1.top()==s2[j])
		{
			p1.pop();
			j++;
			rail[k++]=12;
		}
		else if(!p2.empty()&&p2.top()==s2[j])
		{
			p2.pop();
			j++;
			rail[k++]=32;
		}
		else if(!p1.empty()&&p1.top()<s2[j]){
		p2.push(p1.top());
		p1.pop();
		rail[k++]=13;
		}
		else 
		{
			flag=1;
			break;
		}
	}
	if(flag==0){
		for(i=0;i<k;i++)
		{
			if(rail[i]==12)
			cout<<"1->2";
			else if(rail[i]==32)
			cout<<"3->2";
			else if(rail[i]==13)
			cout<<"1->3";
			if(i!=k-1)
			cout<<"\n";
		}
	}
	else
	cout<<"Are you kidding me?";
	return 0;
}
